package assembly.spring.boot.demo.config.mybatis.flex;

import com.mybatisflex.annotation.InsertListener;

import java.sql.Timestamp;


public class IDTInsertListener implements InsertListener {
  @Override
  public void onInsert(Object o) {
    IDTBaseEntity baseEntity = (IDTBaseEntity) o;
    baseEntity.setCreateTime(new Timestamp(System.currentTimeMillis()));
    baseEntity.setCreatorId("system");
    baseEntity.setModifyTime(new Timestamp(System.currentTimeMillis()));
    baseEntity.setModifierId("system");
  }
}
